#include "widget.h"
#include "ui_widget.h"
#include <QPushButton>
#include <QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    QPushButton *pushButton = new QPushButton(this);
    pushButton->setText("按钮！");
    pushButton->move(250,200);

    connect(pushButton,&QPushButton::clicked,this,[=](){
       qDebug() << "pushButton clicked";
       pushButton->move(300,300);
       this->move(100,100);
    });
}

Widget::~Widget()
{
    delete ui;
}

